home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / TDDOC.PAK / TD_ASM.TXT next >
Text File  |  1997-05-06  |  31KB  |  774 lines

  1. /*************************************************************************/
  2.                              TURBO DEBUGGER
  3.                         Assembler-level debugging
  4.  
  5. This file contains information about Assembler-level debugging. The
  6. contents of the file are as follows:
  7.  
  8. 1. When source debugging isn't enough
  9. 2. The assembler
  10. 3. Assembler-specific bugs
  11. 4. Inline assembler tips
  12. 5. Inline assembler keywords
  13. 6. The Numeric Processor window
  14.  
  15. The material in this file is for programmers who are familiar with
  16. programming the 80x86 processor family in assembler. You don't need
  17. to use the information in this chapter to debug your programs, but
  18. there are certain problems that might be easier to find using
  19. the techniques discussed here.
  20.  
  21.  
  22. ===================================================================
  23. 1. When source debugging isn't enough
  24. ===================================================================
  25. Sometimes, however, you can gain insight into a problem by looking
  26. at the exact instructions that the compiler generated, the contents
  27. of the CPU registers, and the contents of the stack. To do this,
  28. you need to be familiar with both the 80x86 family of processors
  29. and with how the compiler turns your source code into machine
  30. instructions. Because many excellent books are available about the
  31. internal workings of the CPU, we won't go into that in detail here.
  32. You can quickly learn how the compiler turns your source code into
  33. machine instructions by looking at the instructions generated for
  34. each line of source code within the CPU window.
  35.  
  36. Turbo Debugger can detect an 8087, 80287, 80387, or 80486 numeric
  37. coprocessor and disassemble those instructions if a floating-point
  38. chip or emulator is present.
  39.  
  40. The instruction mnemonic RETF indicates that this is a far return
  41. instruction. The normal RET mnemonic indicates a near return.
  42.  
  43. Where possible, the target of JMP and CALL instructions is
  44. displayed symbolically. If CS:IP is a JMP or conditional jump
  45. instruction, an up-arrow or down-arrow that shows jump direction
  46. will be displayed only if the executing instruction will cause the
  47. jump to occur. Also, memory addresses used by MOV, ADD, and other
  48. instructions display symbolic addresses.
  49.  
  50.  
  51. ===================================================================
  52. 2. The assembler
  53. ===================================================================
  54. If you use the Assemble command in the Code pane local menu, Turbo
  55. Debugger lets you assemble instructions for the 8086, 80186, 80286,
  56. 80386, and 80486 processors, and also for the 8087, 80287, and 80387
  57. numeric coprocessors.
  58.  
  59. When you use Turbo Debugger's built-in assembler to modify your program,
  60. the changes you make are not permanent. If you reload your program Run|
  61. Program Reset, or if you load another program using File|Open,
  62. you'll lose any changes you've made.
  63.  
  64. Normally you use the assembler to test an idea for fixing your program.
  65. Once you've verified that the change works, you must change your source
  66. code and recompile and link your program.
  67.  
  68. The following sections describe the differences between the built-
  69. in assembler and the syntax accepted by Borland C++'s inline
  70. assembler.
  71.  
  72.  
  73. Operand address size overrides
  74. ==============================
  75. For the call (CALL), jump (JMP), and conditional jump (JNE, JL, and
  76. so forth) instructions, the assembler automatically generates the
  77. smallest instruction that can reach the destination address. You
  78. can use the NEAR and FAR overrides before the destination address
  79. to assemble the instruction with a specific size. For example,
  80.  
  81.   CALL FAR XYZ
  82.   JMP  NEAR A1
  83.  
  84.  
  85. Memory and immediate operands
  86. -----------------------------
  87. When you use a symbol from your program as an instruction operand,
  88. you must tell the built-in assembler whether you mean the contents
  89. of the symbol or the address of the symbol. If you use just the
  90. symbol name, the assembler treats it as an address, exactly as if
  91. you had used the assembler OFFSET operator before it. If you put
  92. the symbol inside brackets ([ ]), it becomes a memory reference.
  93. For example, if your program contains the data definition
  94.  
  95.   A    DW 4
  96.  
  97. then "A" references the area of memory where A is stored.
  98.  
  99. When you assemble an instruction or evaluate an assembler
  100. expression to refer to the contents of a variable, use the name of
  101. the variable alone or between brackets:
  102.  
  103.   mov dx,a
  104.   mov ax,[a]
  105.  
  106. To refer to the address of the variable, use the OFFSET operator:
  107.  
  108.   mov ax,offset a
  109.  
  110.  
  111. Operand data size overrides
  112. ===========================
  113. For some instructions, you must specify the operand size using one
  114. of the following expressions before the operand:
  115.  
  116.   BYTE PTR
  117.   WORD PTR
  118.  
  119. Here are examples of instructions using these overrides:
  120.  
  121.   add BYTE PTR[si],10
  122.   mov WORD PTR[bp+10],99
  123.  
  124. In addition to these size overrides, you can use the following
  125. overrides to assemble 8087/80287/80387/80486 numeric processor
  126. instructions:
  127.  
  128.   DWORD PTR
  129.   QWORD PTR
  130.   TBYTE PTR
  131.  
  132. Here are some examples using these overrides:
  133.  
  134.   fild QWORD PTR[bx]
  135.   stp  TBYTE PTR[bp+4]
  136.  
  137.  
  138. String instructions
  139. ===================
  140. When you assemble a string instruction, you must include the size
  141. (byte or word) as part of the instruction mnemonic. The assembler
  142. does not accept the form of the string instructions that uses a
  143. sizeless mnemonic with an operand that specifies the size. For
  144. example, use STOSW rather than STOS WORD PTR[di].
  145.  
  146.  
  147. =========================================
  148. 3. Assembler-specific bugs
  149. =========================================
  150. This section, which covers some of the common pitfalls of assembly
  151. language programming, is intended for people who have Turbo Assembler
  152. or use inline assembler in C++ programs. You should refer to the
  153. Turbo Assembler User's Guide for a fuller explanation on these
  154. often encountered errors--and tips on how to avoid them.
  155.  
  156. Forgetting to return to DOS
  157. ===========================
  158. In C++, a program ends automatically when there is no more code to
  159. execute, even if no explicit termination command was written into the
  160. program. Not so in assembly language, where only those actions that
  161. you explicitly request are performed. When you run a program that has
  162. no command to return to DOS, execution simply continues right past the
  163. end of the program's code and into whatever code happens to be in the
  164. adjacent memory.
  165.  
  166.  
  167. Forgetting a RET instruction
  168. ============================
  169. The proper invocation of a subroutine consists of a call to the subroutine
  170. from another section of code, execution of the subroutine, and a return
  171. from the subroutine to the calling code. Remember to insert a RET
  172. instruction in each subroutine, so that the RETurn to the calling code
  173. occurs. When you're typing a program, it's easy to skip a RET and end
  174. up with an error.
  175.  
  176.  
  177. Generating the wrong type of return
  178. ===================================
  179. The PROC directive has two effects. First, it defines a name by which a
  180. procedure can be called. Second, it controls whether the procedure is a near
  181. or far procedure.
  182.  
  183. The RET instructions in a procedure should match the type of the procedure,
  184. shouldn't they?
  185.  
  186. Yes and no. The problem is that it's possible and often desirable to group
  187. several subroutines in the same procedure. Since these subroutines lack an
  188. associated PROC directive, their RET instructions take on the type of the
  189. overall procedure, which is not necessarily the correct type for the
  190. individual subroutines.
  191.  
  192.  
  193. Reversing operands
  194. ==================
  195. To many people, the order of instruction operands in 8086 assembly language
  196. seems backward (and there is certainly some justification for this
  197. viewpoint). If the line
  198.  
  199.   mov  ax,bx
  200.  
  201. meant "move AX to BX," the line would scan smoothly from left to right, and
  202. this is exactly the way in which many microprocessor manufacturers have
  203. designed their assembly languages.
  204.  
  205. However, Intel took a different approach with 8086 assembly language; for
  206. us, the line means "move BX to AX," and that can sometimes cause confusion.
  207.  
  208.  
  209. Forgetting the stack or reserving a too-small stack
  210. ===================================================
  211. In most cases, you're treading on thin ice if you don't explicitly allocate
  212. space for a stack. Programs without an allocated stack sometimes run, but
  213. there is no assurance that these programs will run under all circumstances.
  214. DOS programs can have a .STACK directive to reserve space for the stack.
  215. For each program, you should reserve more than enough space for the
  216. deepest stack the program can use.
  217.  
  218.  
  219. Calling a subroutine that wipes out registers
  220. =============================================
  221. When you're writing assembler code, it's easy to think of the registers
  222. as local variables, dedicated to the use of the procedure you're working
  223. on at the moment. In particular, there's a tendency to assume that
  224. registers are unchanged by calls to other procedures. It just isn't
  225. so--the registers are global variables, and each procedure can preserve or
  226. destroy any or all registers.
  227.  
  228.  
  229. Using the wrong sense for a conditional jump
  230. ============================================
  231. The profusion of conditional jumps in assembly language (JE, JNE, JC,
  232. JNC, JA, JB, JG, and so on) allows tremendous flexibility in writing
  233. code--and also makes it easy to select the wrong jump for a given purpose.
  234. Moreover, since condition-handling in assembly language requires at least
  235. two separate lines, one for the comparison and one for the conditional
  236. jump (it requires many more lines for complex conditions), assembly
  237. language condition-handling is less intuitive and more prone to errors than
  238. condition-handling in C++.
  239.  
  240.  
  241. Forgetting about REP string overrun
  242. ===================================
  243. String instructions have a curious property: After they're executed, the
  244. pointers they use wind up pointing to an address 1 byte away (or 2 bytes
  245. for a word instruction) from the last address processed. This can cause
  246. some confusion with repeated string instructions, especially REP SCAS and
  247. REP CMPS.
  248.  
  249.  
  250. Relying on a zero CX to cover a whole segment
  251. =============================================
  252. Any repeated string instruction executed with CX equal to zero does nothing.
  253. This can be convenient in that there's no need to check for the zero
  254. case before executing a repeated string instruction; on the other hand,
  255. there's no way to access every byte in a segment with a byte-sized string
  256. instruction.
  257.  
  258.  
  259. Using incorrect direction flag settings
  260. =======================================
  261. When a string instruction is executed, its associated pointer or pointers--
  262. SI or DI or both--increment or decrement. It all depends on the state of the
  263. direction flag.
  264.  
  265. The direction flag can be cleared with CLD to cause string instructions to
  266. increment (count up) and can be set with STD to cause string instructions to
  267. decrement (count down). Once cleared or set, the direction flag stays in the
  268. same state until either another CLD or STD is executed, or until the flags
  269. are popped from the stack with POPF or IRET. While it's handy to be able to
  270. program the direction flag once and then execute a series of string
  271. instructions that all operate in the same direction, the direction flag can
  272. also be responsible for intermittent and hard-to-find bugs by causing the
  273. behavior of string instructions to depend on code that executed much earlier.
  274.  
  275.  
  276. Using the wrong sense for a repeated string comparison
  277. ======================================================
  278. The CMPS instruction compares two areas of memory; the SCAS instruction
  279. compares the accumulator to an area of memory. Prefixed by REPE, either
  280. of these instructions can perform a comparison until either CX becomes
  281. zero or a not-equal comparison occurs. Unfortunately, it's easy to become
  282. confused about which of the REP prefixes does what.
  283.  
  284.  
  285. Forgetting about string segment defaults
  286. ========================================
  287. Each of the string instructions defaults to using a source segment (if any)
  288. of DS, and a destination segment (if any) of ES. It's easy to forget this
  289. and try to perform, say, a STOSB to the data segment, since that's where
  290. all the data you're processing with non-string instructions normally resides.
  291.  
  292.  
  293. Converting incorrectly from byte to word operations
  294. ===================================================
  295. In general, it's desirable to use the largest possible data size (usually
  296. word, but dword on an 80386) for a string instruction, since string
  297. instructions with larger data sizes often run faster.
  298.  
  299. There are a couple of potential pitfalls here. First, the conversion from a
  300. byte count to a word count by a simple
  301.  
  302.   shr cx,1
  303.  
  304. loses a byte if CX is odd, since the least-significant bit is shifted out.
  305.  
  306. Second, make sure you remember SHR divides the byte count by two. Using,
  307. say, STOSW with a byte rather than a word count can wipe out other data
  308. and cause problems of all sorts.
  309.  
  310.  
  311. Using multiple prefixes
  312. =======================
  313. String instructions with multiple prefixes are error-prone and should
  314. generally be avoided.
  315.  
  316.  
  317. Relying on the operand(s) to a string instruction
  318. =================================================
  319. The optional operand or operands to a string instruction are used for data
  320. sizing and segment overrides only, and do not guarantee that the memory
  321. location referenced is accessed.
  322.  
  323.  
  324. Wiping out a register with multiplication
  325. =========================================
  326. Multiplication--whether 8 bit by 8 bit, 16 bit by 16 bit, or 32 bit by 32
  327. bit--always destroys the contents of at least one register other than the
  328. portion of the accumulator used as a source operand.
  329.  
  330.  
  331. Forgetting that string instructions alter several registers
  332. ===========================================================
  333. The string instructions, MOVS, STOS, LODS, CMPS, and SCAS, can affect several
  334. of the flags and as many as three registers during execution of a single
  335. instruction. When you use string instructions, remember that SI, DI, or
  336. both either increment or decrement (depending on the state of the direction
  337. flag) on each execution of a string instruction. CX is also decremented at
  338. least once, and possibly as far as zero, each time a string instruction with
  339. a REP prefix is used.
  340.  
  341.  
  342. Expecting certain instructions to alter the carry flag
  343. ======================================================
  344. While some instructions affect registers or flags unexpectedly, other
  345. instructions don't even affect all the flags you might expect them to.
  346.  
  347.  
  348. Waiting too long to use flags
  349. =============================
  350. Flags last only until the next instruction that alters them, which is
  351. usually not very long. It's a good practice to act on flags as soon as
  352. possible after they're set, thereby avoiding all sorts of potential bugs.
  353.  
  354.  
  355. Confusing memory and immediate operands
  356. =======================================
  357. An assembler program may refer either to the offset of a memory variable or
  358. to the value stored in that memory variable. Unfortunately, assembly language
  359. is neither strict nor intuitive about the ways in which these two types of
  360. references can be made, and as a result, offset and value references to a
  361. memory variable are often confused.
  362.  
  363.  
  364. Failing to preserve everything in an interrupt handler
  365. ======================================================
  366. Every interrupt handler should explicitly preserve the contents of all
  367. registers. While it is valid to preserve explicitly only those registers
  368. that the handler modifies, it's good insurance just to push all registers
  369. on entry to an interrupt handler and pop all registers on exit.
  370.  
  371.  
  372. Forgetting group overrides in operands and data tables
  373. ======================================================
  374. Segment groups let you partition data logically into a number of areas
  375. without having to load a segment register every time you want to switch
  376. from one of those logical data areas to another.
  377.  
  378.  
  379.  
  380. =========================================
  381. 4. Inline assembler tips
  382. =========================================
  383.  
  384. Looking at raw hex data
  385. =======================
  386. You can use the Data|Add Watch and Data| Evaluate/Modify commands with
  387. a format modifier to look at raw data dumps. For example, if your
  388. language is Assembler,
  389.  
  390.   [ES:DI],20m
  391.  
  392. specifies that you want to look at a raw hex memory dump of the 20 bytes
  393. pointed to by the ES:DI register pair.
  394.  
  395.  
  396. Source-level debugging
  397. ======================
  398. You can step through your assembler code using a Module window just as
  399. with any of the high-level languages. If you want to see the register
  400. values, you can put a Registers window to the right of the Module window.
  401.  
  402. Sometimes, you may want to use a CPU window and see your source code as
  403. well. To do this, open a CPU window and choose the Code pane's Mixed
  404. command until it reads Both. That way you can see both your source code
  405. and machine code bytes. Remember to zoom the CPU window (by pressing F5)
  406. if you want to see the machine code bytes.
  407.  
  408.  
  409. Examining and changing registers
  410. ================================
  411. The obvious way to change registers is to highlight a register in either
  412. a CPU window or Registers window. A quick way to change a register is to
  413. choose Data|Evaluate/Modify. You can enter an assignment expression that
  414. directly modifies a register's contents. For example,
  415.  
  416.    SI = 99
  417.  
  418. loads the SI register with 99.
  419.  
  420. Likewise, you can examine registers using the same technique. For example,
  421.  
  422.    Alt-D E AX
  423.  
  424. shows you the value of the AX register.
  425.  
  426.  
  427. =========================================
  428. 5. Inline assembler keywords
  429. =========================================
  430. This section lists the instruction mnemonics and other special symbols that
  431. you use when entering instructions with the inline assembler. The keywords
  432. presented here are the same as those used by Turbo Assembler.
  433.  
  434.  
  435. 8086/80186/80286 instructional mnemonics
  436. _________________________________________
  437.   AAA        INC        LIDT**     REPNZ
  438.   AAD        INSB*      LLDT**     REPZ
  439.   AAM        INSW*      LMSW**     RET
  440.   AAS        INT        LOCK       REFT
  441.   ADC        INTO       LODSB      ROL
  442.   ADD        IRET       LODSW      ROR
  443.   AND        JB         LOOP       SAHF
  444.   ARPL**     JBE        LOOPNZ     SAR
  445.   BOUND*     JCXZ       LOOPZ      SBB
  446.   CALL       JE         LSL**      SCASB
  447.   CLC        JL         LTR**      SCASW
  448.   CLD        JLE        MOV        SGDT**
  449.   CLI        JMP        MOVSB      SHL
  450.   CLTS**     JNB        MOVSW      SHR
  451.   CMC        JNBE       MUL        SLDT**
  452.   CMP        JNE        NEG        SMSW**
  453.   CMPSB      JNLE       NOP        STC
  454.   CMPSW      JNO        NOT        STD
  455.   CWD        JNP        OR         STI
  456.   DAA        JO         OUT        STOSB
  457.   DAS        JP         OUTSB      STOSW
  458.   DEC        JS         OUTSW      STR**
  459.   DIV        LAHF       POP        SUB
  460.   ENTER*     LAR**      POPA*      TEST
  461.   ESC        LDS        POPF       WAIT
  462.   HLT        LEA        PUSH       VERR**
  463.   IDIV       LEAVE      PUSHA*     VERW**
  464.   IMUL       LES        PUSHF      XCHG
  465.   IN         LGDT**     RCL        XLAT
  466.                                    XOR
  467. ___________________________________________
  468.  
  469. * Available only when running on the 186 and 286 processor
  470. ** Available only when running on the 286 processor
  471.  
  472.  
  473. Turbo Debugger supports all 80386 and 80387 instruction
  474. mnemonics and registers:
  475.  
  476. 80386 instruction mnemonics
  477. _________________________________________
  478.  
  479.   BSF        LSS         SETG        SETS
  480.   BSR        MOVSX       SETL        SHLD
  481.   BT         MOVZX       SETLE       SHRD
  482.   BTC        POPAD       SETNB       CMPSD
  483.   BTR        POPFD       SETNE       STOSD
  484.   BTS        PUSHAD      SETNL       LODSD
  485.   CDQ        PUSHFD      SETNO       MOVSD
  486.   CWDE       SETA        SETNP       SCASD
  487.   IRETD      SETB        SETNS       INSD
  488.   LFS        SETBE       SETO        OUTSD
  489.   LGS        SETE        SETP        JECXZ
  490. __________________________________________
  491.  
  492. 80486 instruction mnemonics
  493. _________________________________________
  494.  
  495.        BSWAP               INVLPG
  496.        CMPXCHG             WBINVD
  497.        INVD                XADD
  498. _________________________________________
  499.  
  500. 80386 registers
  501. _________________________________________
  502.  
  503.        EAX                 EDI
  504.        EBX                 EBP
  505.        ECX                 ESP
  506.        EDX                 FS
  507.        ESI                 GS
  508. _________________________________________
  509.  
  510. CPU registers
  511. __________________________________________________________________
  512.  
  513. Byte registers            AH, AL, BH, BL, CH, CL, DH, DL
  514.  
  515. Word registers            AX, BX, CX, DX, SI, DI, SP, BP, FLAGS
  516.  
  517. Segment registers         CS, DS, ES, SS
  518.  
  519. Floating registers        ST, ST(0), ST(1), ST(2), ST(3), ST(4),
  520.                           ST(5), ST(6), ST(7)
  521. ___________________________________________________________________
  522.  
  523. Special keywords
  524. _________________________________________
  525.  
  526.        WORD PTR            TBYTE PTR
  527.        BYTE PTR            NEAR
  528.        DWORD PTR           FAR
  529.        QWORD PTR           SHORT
  530. _________________________________________
  531.  
  532. 8087/80287 numeric coprocessor instruction mnemonics
  533. ____________________________________________________
  534.   FABS       FIADD      FLDL2E     FST
  535.   FADD       FIACOM     FLDL2T     FSTCW
  536.   FADDP      FIACOMP    FLDPI      FSTENV
  537.   FBLD       FIDIV      FLDZ       FSTP
  538.   FBSTP      FIDIVR     FLD1       FSTSW**
  539.   FCHS       FILD       FMUL       FSUB
  540.   FCLEX      FIMUL      FMULP      FSUBP
  541.   FCOM       FINCSTP    FNOP       FSUBR
  542.   FCOMP      FINIT      FNSTS**    FSUBRP
  543.   FCOMPP     FIST       FPATAN     FTST
  544.   FDECSTP    FISTP      FPREM      FWAIT
  545.   FDISI      FISUB      FPTAN      FXAM
  546.   FDIV       FISUBR     FRNDINT    FXCH
  547.   FDIVP      FLD        FSAVENT    FXTRACT
  548.   FDIVR      FLDCWR     FSCALE     FYL2X
  549.   FDIVRP     FLDENV     FSETPM*    FYL2XPI
  550.   FENI       FLDLG2     FSQRT      F2XM1
  551.   FFREE      FLDLN2     
  552. _____________________________________________________
  553.  
  554. * Available only when running on the 287 numeric coprocessor.
  555. ** On the 80287, the fstsw instruction can use the AX register as an
  556.    operand, as well as the normal memory operand.
  557.  
  558.  
  559. 80387 instruction mnemonics
  560. _________________________________________
  561.  
  562.        FCOS                FUCOM
  563.        FSIN                FUCOMP
  564.        FPREM1              FUCOMPP
  565.        FSINCOS
  566. _________________________________________
  567.  
  568.  
  569. The 80x87 coprocessor chip and emulator
  570. =======================================
  571. This section is for programmers who are familiar with the operation
  572. if the 80x87 math coprocessor. If your program uses floating-point
  573. numbers, Turbo Debugger lets you examine and change the state of the numeric
  574. coprocessor or, if the coprocessor is emulated, examine the state of the
  575. software emulator. (Windows permits you only to examine the state of the
  576. emulator, not to change it.)  You don't need to use the capabilities
  577. described in this chapter to debug programs that use floating-point numbers,
  578. although some very subtle bugs may be easier to find.
  579.  
  580. In this section, we discuss the differences between the 80x87 chip and
  581. the software emulator. We also describe the Numeric Processor window and
  582. show you how to examine and modify the floating-point registers, the status
  583. bits, and the control bits.
  584.  
  585.  
  586. The 80x87 chip vs. the emulator
  587. ===============================
  588. TDW automatically detects whether your program is using the math chip or the
  589. emulator and adjusts its behavior accordingly.
  590.  
  591. Note that most programs use either the emulator or the math chip, not both
  592. within the same program. If you have written special assembler code that
  593. uses both, TDW won't be able to show you the status of the math chip; it
  594. reports on the emulator only.
  595.  
  596.  
  597. =========================================
  598. 6. The Numeric Processor window
  599. =========================================
  600. You create a Numeric Processor window by choosing the View|Numeric Processor
  601. command from the menu bar. The line at the top of the window shows the
  602. current instruction pointer, opcode, and data pointer. The instruction
  603. pointer is both shown as a 20-bit physical address. The data pointer is
  604. either a 16-bit or a 20-bit address, depending on the memory model. You
  605. can convert 20-bit addresses to segment and offset form by using the first
  606. four digits as the segment value and the last digit as the offset value.
  607.  
  608. For example, if the top line shows IPTR=5A669, you can treat this as the
  609. address 5a66:9 if you want to examine the current data and instruction in
  610. a CPU window. This window has three panes: The left pane (Register pane)
  611. shows the contents of the floating-point registers, the middle pane
  612. (Control pane) shows the control flags, and the right pane (Status pane)
  613. shows the status flags.
  614.  
  615. The top line shows you the following information about the last floating-
  616. point operation that was executed:
  617.  
  618. o Emulator indicates that the numeric processor is being emulated. If there
  619.   were a numeric processor, 8087, 80287, 80387, or 80486 would appear instead.
  620.  
  621. o The IPTR shows the 20-bit physical address from which the last floating-
  622.   point instruction was fetched.
  623.  
  624. o The OPCODE shows the instruction type that was fetched.
  625.  
  626. o The OPTR shows the 16-bit or 20-bit physical address of the memory address
  627.   that the instruction referenced, if any.
  628.  
  629.  
  630. The Register pane
  631. -----------------
  632.  
  633.     The 80-bit floating-point registers
  634.     -----------------------------------
  635.  
  636.     The Register pane shows each of the floating-point registers, ST(0) to
  637.     ST(7), along with its status (valid/zero/special/empty). The contents
  638.     are shown as an 80-bit floating-point number.
  639.  
  640.     If you've zoomed the Numeric Processor window (by pressing F5) or made
  641.     it wider by using Window|Size/Move, you'll also see the floating-point
  642.     registers displayed as raw hex bytes.
  643.  
  644.  
  645.     The Register pane's local menu
  646.     ------------------------------
  647.     ___________
  648.    | Zero      |
  649.    | Empty     |
  650.    | Change... |
  651.    |___________|
  652.  
  653.     To bring up the Register pane local menu, press Alt-F10, or use the Ctrl
  654.     key with the first letter of the desired command to directly access the
  655.     command.
  656.  
  657.     Zero
  658.     ----
  659.     Sets the value of the currently highlighted register to zero.
  660.  
  661.     Empty
  662.     -----
  663.     Sets the value of the currently highlighted register to empty. This is a
  664.     special status that indicates that the register no longer contains valid
  665.     data.
  666.  
  667.     Change
  668.     ------
  669.     Loads a new value into the currently highlighted register. You are
  670.     prompted for the value to load. You can enter an integer or floating-
  671.     point value, using the current language's expression parser. The value
  672.     you enter is automatically converted to the 80-bit temporary real format
  673.     used by the numeric coprocessor.
  674.  
  675.     You can also invoke this command by simply starting to type the new value
  676.     for the floating-point register. A dialog box appears, exactly as if you
  677.     had specified the Change command.
  678.  
  679.  
  680. The Control pane
  681. ----------------
  682.  
  683.     The control bits
  684.     ----------------
  685.  
  686.     The following table lists the different control flags and how they
  687.     appear in the Control pane:
  688. _________________________________________
  689.  
  690.    Name in pane         Flag description__
  691.  
  692.       im                Invalid operation mask
  693.       dm                Denormalized operand mask
  694.       zm                Zero divide mask
  695.       om                Overflow mask
  696.       um                Underflow mask
  697.       pm                Precision mask
  698.       iem               Interrupt enable mask (8087 only)
  699.       pc                Precision control
  700.       rc                Rounding control
  701.       ic                Infinity control__
  702.  
  703.  
  704.     The Control pane's local menu
  705.     -----------------------------
  706.        ________
  707.       | Toggle |
  708.       |________|
  709.  
  710.     Press Tab to go to the Control pane, then press Alt-F10 to pop up the
  711.     local menu. (Alternatively, you can use the Ctrl key with the first letter
  712.     of the desired command to access it.)
  713.  
  714.     Toggle
  715.     ------
  716.     Cycles through the values that the currently highlighted control flag
  717.     can be set to. Most flags can only be set or cleared (0 or 1), so this
  718.     command just toggles the flag to the other value. Some other flags have
  719.     more than two values; for those flags, this command increments the flag
  720.     value until the maximum value is reached, and then sets it back to zero.
  721.  
  722.     You can also toggle the control flag values by highlighting them and
  723.     pressing Enter.
  724.  
  725.  
  726. The Status pane
  727. ---------------
  728.  
  729.     The status bits
  730.     ---------------
  731.  
  732.     The following table lists the different status flags and how they appear
  733.     in the Status pane:
  734. ____________________________________
  735.  
  736.    Name in pane         Flag description__
  737.  
  738.       ie                Invalid operation
  739.       de                Denormalized operand
  740.       ze                Zero divide
  741.       oe                Overflow
  742.       ue                Underflow
  743.       pe                Precision
  744.       ir                Interrupt request
  745.       cc                Condition code
  746.       st                Stack top pointer_
  747.  
  748.  
  749.     The Status pane's local menu
  750.     ----------------------------
  751.        ________
  752.       | Toggle |
  753.       |________|
  754.  
  755.     Press Tab to move to the Statuspane, then press Alt-F10 to pop up the
  756.     local menu. (You can also use the Ctrl key with the first letter of the
  757.     desired command to access the command directly.)
  758.  
  759.  
  760.     Toggle
  761.     ------
  762.     Cycles through the values that the currently highlighted status flag
  763.     can be set to. Most flags can only be set or cleared (0 or 1), so this
  764.     command just toggles the flag to the other value. Some other flags have
  765.     more than two values; for those flags, this command increments the
  766.     flag value until the maximum value is reached, and then sets it back to
  767.     zero.
  768.  
  769.     You can also toggle the status flag values by highlighting them and
  770.     pressing Enter.
  771.  
  772. /***************************** END OF FILE *******************************/
  773.  
  774.